package com.tqz.dt.status;


import org.springframework.transaction.TransactionException;
import org.springframework.transaction.TransactionStatus;

/**
 * <p>事务状态接口
 *
 * @author tianqingzhao
 * @since 2021/7/7 15:30
 */
public abstract class AbstractTransactionStatus implements TransactionStatus {

    private boolean rollbackOnly = false;

    private boolean completed = false;

    @Override
    public boolean isNewTransaction() {
        return false;
    }

    @Override
    public boolean hasSavepoint() {
        return false;
    }

    @Override
    public void setRollbackOnly() {
        this.rollbackOnly = true;
    }

    @Override
    public boolean isRollbackOnly() {
        return this.rollbackOnly;
    }

    @Override
    public void flush() {

    }

    @Override
    public boolean isCompleted() {
        return this.completed;
    }

    @Override
    public Object createSavepoint() throws TransactionException {
        return null;
    }

    @Override
    public void rollbackToSavepoint(Object savepoint) throws TransactionException {

    }

    @Override
    public void releaseSavepoint(Object savepoint) throws TransactionException {

    }
}
